<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<h2>我是服务器：<span th:text="${#request.getLocalPort()}"></span></h2>
<h2>当前sessionId：<span th:text="${#session} == null ? 'session为空' : ${#session.getId()}"></span></h2>
<div>
    <form method="post" th:action="@{toIndex}">
        <table>
            <tr>
                <td>用户名：</td>
                <td><input type="text" name="username"></td>
            </tr>
            <tr>
                <td>密码：</td>
                <td><input type="password" name="password"> <input type="submit" value="登录"></td>
            </tr>
        </table>
    </form>
</div>
</body>
</html>